package com.loocup.demo1;

import com.loocup.demo1.bean.CustomerService;
import com.loocup.demo1.config.AdviceConfig;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class AdviceApp {
    public static void main(String[] args) {

        ApplicationContext ac = new AnnotationConfigApplicationContext(AdviceConfig.class);
        CustomerService customerService = (CustomerService) ac.getBean("customerServiceProxy");

        System.out.println("*************************");
        customerService.printName();
        System.out.println("*************************");
        customerService.printURL();
        System.out.println("*************************");
        try {
            customerService.printThrowException();
        } catch (Exception e) {

        }
    }
}
